<div>
  <ul class="am-list admin-sidebar-list user-nav" id="collapase-nav-1">
  <li class="am-panel">
    <a data-am-collapse="{target: '#user-nav'}">我的物品</a>
    <ul class="am-collapse admin-sidebar-sub user-nav-child am-in" id="user-nav">
        <li class=""><a href="{:url('goods/goodsList',['status' => 1])}">正在出售 </a></li>
        <li><a href="{:url('goods/goodsList',['status' => 2])}">已经售出 </a></li>
        <li><a href="{:url('goods/goodsList',['status' => 3])}">下架产品 </a></li>
        <li><a href="{:url('goods/goodsList',['status' => 5])}">审核中 </a></li>
        <li><a href="{:url('goods/goodsList',['status' => -1])}">未通过 </a></li>
        <li><a href="{:url('goods/goodsList',['status' => 0])}">回收站 </a></li>
    </ul>
  </li>

  <li class="am-panel">
    <a data-am-collapse="{target: '#company-nav'}">我的订单</a>
    <ul class="am-collapse am-in admin-sidebar-sub user-nav-child" id="company-nav">
        <li><a href="#">添加单位</a></li>
        <li><a href="#">单位</a></li>
    </ul>
  </li>
  <li class="am-panel"><a href="{:url('user/feedback/index')}">留言板</a></li>
  <li class="am-panel">
    <a data-am-collapse="{target: '#role-nav'}">我的账户</a>
    <ul class="am-collapse am-in admin-sidebar-sub user-nav-child" id="role-nav">
        <li class=""><a href="{:url('user/index')}">基本资料</a></li>
        <li><a href="#/roleList/0">安全管理</a></li>
    </ul>
  </li>

</ul>
</div>
<script type="text/javascript">
var a = $('.user-nav a');
var url = location.href;
for(var k=0; k < a.length; k++){
    //console.log(a[k].href);
    //console.log(url);
    //暂不考虑包含#的url
    if (a[k].href.indexOf('#') >= 0) {
        continue;
    }
    if (a[k].href != '' && url.indexOf(a[k].href) >= 0) {
        $(a[k]).parent().addClass('am-active');
        break;
    }
}
</script>
